home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Video Toaster 4.3
/
Video Toaster v4.3.iso
/
4.2
/
arexx
/
modeler
/
wedge.lwm
< prev
next >
Wrap
Text File
|
1998-04-16
|
2KB
|
104 lines
/* CMD: Wedge
* Make Wedge/Ring in Modeler */
/* By Arnie Cachelin Copyright © 1992 NewTek, Inc. */
arg angle startangle name
if angle="" then angle=360
if startangle="" then startangle=0
Ax='Y'
libadd = addlib("LWModelerARexx.port",0)
signal on error
signal on syntax
if name="" then name="Wedge"
else name=strip(name)
call req_begin "Wedge"
AxId = req_addcontrol("Axis", "CH",'X Y Z')
SegId = req_addcontrol("Degrees per Section",'N',0)
TopId = req_addcontrol("Top",'N',0)
BotId = req_addcontrol("Bottom",'N',0)
InRadId = req_addcontrol("Inner Radius",'N',0)
OutRadId = req_addcontrol("Outer Radius",'N',0)
StAngId = req_addcontrol("Start Angle",'N',0)
AngId = req_addcontrol("End Angle",'N',0)
SurfId = req_addcontrol("Surface",'R')
call req_setval SegId, 10,22.5
call req_setval AxId, 2
call req_setval TopId, 1,1
call req_setval BotId, 0,0
call req_setval InRadId, .5,0
call req_setval OutRadId, 1,1
call req_setval StAngId, startangle
call req_setval AngId, angle
x = req_post()
if (x) then do
degs= req_getval(SegId)
Ax= req_getval(AxId)
name= req_getval(SurfId)
startangle= req_getval(StAngId)
angle= req_getval(AngId)
top= req_getval(TopId)
bot= req_getval(BotId)
r1= req_getval(InRadId)
r2= req_getval(OutRadId)
call req_end()
end
else do
call req_end()
exit
end
segs=abs(angle-startangle)%degs
if Ax=1 then do
Ax='X'
lax='Z'
lc=top' 'r1' 0'
hc=bot' 'r2' 0'
end
else if Ax=2 then do
Ax='Y'
lax='Z'
lc=r1' 'top' 0'
hc=r2' 'bot' 0'
end
else if Ax=3 then do
Ax='Z'
lax='Y'
lc=r1' 0 'top
hc=r2' 0 'bot
end
/* Need to clear out objects, or they will be lathed too! :( */
call CUT()
call SURFACE(name)
call MAKEBOX(lc,hc)
call LATHE(Ax,segs,0,angle,startangle)
call PASTE() /* Replace stuff we cleared out :) */
exit
syntax:
error:
call end_all
t=Notify(1,'!Rexx Script Error','@'ErrorText(rc),'Line 'SIGL)
if (libadd) then call remlib("LWModelerARexx.port")
exit
/* Didn't need this ... yet */
GotoScratchLayer: PROCEDURE
curlay=curlayer()
empty = emptylayers()
scr = word(empty, 1)
if (scr = curlay) then
if word(empty, 2)~="" then scr=word(empty,2)
if (scr == "") then do
call notify 1,"!Need an empty layer for scratch work."
exit 10
end
call setlayer(scr)
return(curlay)